perm filename SPH.CH[UHF,DEK] blob
sn#830821 filedate 1986-12-23 generic text, type T, neo UTF8
% change file for HALFTONE.WEB, substitutes a sphere as the input
@x
procedure initialize; {this procedure gets things started properly}
@y
function f(i,j:real):real;
var xx,yy,zz:real;
begin xx←(i-25)/22.3; yy←(j-25)/22.3; zz←1.0-xx*xx-yy*yy;
if zz<0.0 then f←(250*i+j*j)/30000.0
else f←(9+xx-4*yy-8*sqrt(zz))/18.0;
end;
procedure initialize; {this procedure gets things started properly}
@z
@x
begin current[j]←(9*v[i,j]+3*v[i,j+1]+3*v[i-1,j]+v[i-1,j+1])/16
@y
begin current[j]←(f(i-2/6,j+2/6)+f(i-3/6,j+3/6)+f(i-4/6,j+4/6)
+f(i-3/6,j+1/6)+f(i-4/6,j+2/6)+f(i-5/6,j+3/6)
+f(i-1/6,j+3/6)+f(i-2/6,j+4/6)+f(i-3/6,j+5/6))/9.0
@z
@x
begin current[j]←(9*v[i,j]+3*v[i,j-1]+3*v[i+1,j]+v[i+1,j-1])/16
@y
begin current[j]←(f(i+1/6,j-1/6)+f(i+0/6,j-0/6)+f(i-1/6,j+1/6)
+f(i-0/6,j-2/6)+f(i-1/6,j-1/6)+f(i-2/6,j-0/6)
+f(i+2/6,j+0/6)+f(i+1/6,j+1/6)+f(i+0/6,j+2/6))/9.0
@z